package com.itheima.apis.ai;

import com.itheima.model.common.dtos.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@FeignClient(value = "ai-service", fallback = IAiClientFallback.class)
public interface IAiClient {
    
    /**
     * 发送聊天消息
     */
    @PostMapping("/api/v1/chat/send")
    ResponseResult<?> sendMessage(@RequestBody Map<String, Object> request);
    
    /**
     * 获取会话历史
     */
    @GetMapping("/api/v1/chat/history/{sessionId}")
    ResponseResult<?> getHistory(@PathVariable("sessionId") String sessionId, 
                                  @RequestParam("userId") Long userId);
    
    /**
     * 清除会话
     */
    @DeleteMapping("/api/v1/chat/clear/{sessionId}")
    ResponseResult<?> clearSession(@PathVariable("sessionId") String sessionId, 
                                    @RequestParam("userId") Long userId);
    
    /**
     * 获取用户会话列表
     */
    @GetMapping("/api/v1/chat/sessions")
    ResponseResult<?> getSessions(@RequestParam("userId") Long userId);
}

